var $app = new Vue({
    el: '#app',
    data: {
        context: $contextPath || '',
        loading: false,
        condition: {
            subject : ''
        },
        page : {
            data : []
        }

    },
    created: function () {

    },
    methods: {
        /**
         * 查询结果
         */
        queryData : function(tag){
            var _this = this;
            if(_this.condition.subject.trim().length==0){
                _this.$message.info('科目名称不能为空');
                return false;
            }
            _this.loading4save = true;
            $.ajax({
                url : _this.context + '/rule/queryData',
                method : 'POST',
                data : {
                    subject : _this.condition.subject,
                    tag : tag
                },
                success :function(response){
                    if(response.list && response.list.length>0){
                        _this.page.data = response.list;
                        _this.$message.success('查询成功');
                    }else{
                        _this.page.data = [];
                        _this.$message.info('查询结果为空');
                    }
                    _this.loading = false;
                },
                error : function(){
                    _this.$message.info('请求失败');
                    _this.loading = false;
                }
            });
        }
    }
});